import { post } from '@/api/http'

// 列表查询
export const getList = (data) => post({ url: '/sOrderDeposit/pageList', data })

// 根据押金状态获取订单条数
export const getNums = (data) => post({ url: '/sOrderDeposit/getOrderNum', data })

// 押金退款/收取押金
export const returnOrCollectDeposit = (data) => post({ url: '/sOrderDeposit/returnOrCollectDeposit', data })

// 获取押金详情
export const getDetail = (data) => post({ url: '/sOrderDeposit/detail', data })

// 租车押金转违章押金
export const changeDeposit = (data) => post({ url: '/sOrderDeposit/changeDeposit', data })

// 获取页面枚举
export const getEnums = (data) => post({ url: '/sOrderDeposit/getEnums', data })

/**
 * @description: 获取账号前置信息收付款方式
 * @param data
 * @return Promise
 */
export const getAccountByPageData = (data) => {
  // 忽略退款抵扣违约金,需要显示 => 请加字段frontIsIgnore
  if ([undefined, null].includes(data.frontIsIgnore)) {
    data.ignoreWays = ['-2']
  }
  return post({ url: '/inExpAccount/getWayByType', data })
}

/**
 * @description: 根据收付款方式和收付款类型查询账号信息
 * @param data
 * @return Promise
 */
export const getAccountByWayAndType = (data) => post({ url: '/inExpAccount/getAccountByWayAndType', data })

// 导出
export const depositExportExcel = (data) => post({ url: '/sOrderDeposit/exportExcel', data })

// 检查违章押金是否可退
export const checkViolation = (data) => post({ url: '/sOrderDeposit/checkViolation', data })

// 验证押金是否可退
export const checkDeposit = (data) => post({ url: '/sOrderDeposit/depositOperationValidate', data })
